
package com.ruoyi.busi.guide.service.impl;

import com.mybatisflex.spring.service.impl.ServiceImpl;
import com.ruoyi.busi.guide.domain.Experience;
import com.ruoyi.busi.guide.mapper.ExperienceMapper;
import com.ruoyi.busi.guide.service.IExperienceService;
import org.springframework.stereotype.Service;
import java.util.List;

/**
 * 工作经历Service业务层处理
 */
@Service
public class ExperienceServiceImpl extends ServiceImpl<ExperienceMapper, Experience> implements IExperienceService {

    private final ExperienceMapper experienceMapper;

    public ExperienceServiceImpl(ExperienceMapper experienceMapper) {
        this.experienceMapper = experienceMapper;
    }

    @Override
    public List<Experience> selectByMentorId(Long mentorId) {
        if (mentorId == null) {
            throw new IllegalArgumentException("导师ID不能为空");
        }
        return experienceMapper.selectByMentorId(mentorId);
    }

    @Override
    public List<Experience> selectByCompany(String company) {
        if (company == null || company.isEmpty()) {
            throw new IllegalArgumentException("公司名称不能为空");
        }
        return experienceMapper.selectByCompany(company);
    }

    @Override
    public boolean deleteExperienceByIds(List<Long> experienceIds) {
        return this.removeByIds(experienceIds);
    }
}
